//#define SMALL_BLOCK_WIDTH 64
//#define BLOCK_WIDTH 256
#define SMALL_BLOCK_WIDTH 32
#define BLOCK_WIDTH 512
#define GENOPROB_BLOCK_WIDTH 384
//#define GROUP_WIDTH 512*100
#define FORWARD 1
#define BACKWARD 0
#define LARGE 1e10
#define SMALL 1e-1
#define EMISSION_COMPUTE_VECTOR 0
#define EMISSION_COMPUTE_MATRIX 1
#define MARGINALS_NO_XOVER 0
#define MARGINALS_SECOND_XOVER 1
#define MARGINALS_FIRST_XOVER 2
#define MARGINALS_BOTH_XOVER 3
#define HAP_FIRST 0
#define HAP_SECOND 1
#define LOGRANGE 40

short int inline float2short(float f){
  //return (short int)(round(log(f)*819.175));
  return (short int)(round(log(f)/LOGRANGE*SHRT_MAX));
  //return static_cast<short int>(round(log(f)/LOGRANGE*SHRT_MAX));
}

float inline short2float(short s){
  //return exp((float)(s/819.175));
  return exp((float)(s*LOGRANGE/SHRT_MAX));
  //return exp(static_cast<float>(s*LOGRANGE/SHRT_MAX));
  //return pow(2,s*LOGRANGE/SHRT_MAX);
}

typedef struct {
  short compressed[2];
}__attribute__((aligned(4))) packedshort_t;

